# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=geoip
_pkgname="GeoIP"
pkgver=1.6.12
pkgrel=5
pkgdesc="Lookup countries by IP addresses"
url="http://www.maxmind.com/app/ip-location"
arch="all"
license="LGPL-2.1-or-later"
makedepends="zlib-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="https://github.com/maxmind/geoip-api-c/releases/download/v$pkgver/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

prepare() {
 	default_prepare
	update_config_sub
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc/geoip \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info
	make
}

package() {
	make DESTDIR="$pkgdir" install
	mkdir -p "$pkgdir"/usr/share/GeoIP
}

check() {
	make check
}

sha512sums="
a1c8120692a7ba6de5836550917f86f4797dd236a8b7d71b6f92b5389e4b071d89e57036654f5de1d4b762730a2a5c331c31414eab0c889c9befaa097941fee7  GeoIP-1.6.12.tar.gz
"
